<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String id = request.getParameter("id");
	if (id == null) {
		id = "";
	}
%>
<script type="text/javascript">
	$(function() {
		$('#pid').combotree({
			url : '${ctx}/maintenance/brand/treegrid',
			idFiled : 'id',
			textFiled : 'text',
			parentField : 'pid',
			lines : true
		});
<%if (id != "") {%>
	$.post('${ctx}/maintenance/brand/ser/'
				+ $(':input[name="brandId"]').val(), {
			id : $(':input[name="brandId"]').val(),
		}, function(result) {
			if (result.brandId != undefined) {
				//alert(result.status+" 和"+result.remarks+"还有"+result.sort);
				$('form').form('load', {

					'brandId' : result.brandId,
					'brandname' : result.brandname,
					'pid' : result.pid,
					'sort' : result.sort,
					'islast':result.islast,
					'letter':result.letter,
					'type' :result.type,
					'state':result.state,
					'images':result.images
				});
				//alert(result.lid);
				//$('#iconCls').attr('class', result.iconCls);//设置背景图标
			}
			$.messager.progress('close');
		}, 'json');
<%}%>
	});
</script>
<div align="center" id="dil">
	<form id="brand_updateForm" method="POST"  class="zzld_form">
		<input type="hidden" name="brandId" id="brandId" value="<%=id%>" />
		<table class="zzld_table" style="width: 100%">
			<tr>
				<th>名称：</th>
				<td  colspan="3"><input name="brandname"
				      id = "brandname"
					value="" class="easyui-validatebox" data-options="required:true"
					missingMessage="请输入名称!" style="width: 87%;" /></td>
			</tr>
			<tr>
				<th>上级节点：</th>
				<td><input id="pid" name="pid"
					class="easyui-combotree" style="width: 155px;" /></td>
				<th>首写字母：</th>
				<td><input name="letter"
				    id="letter"
					value="" class="easyui-validatebox" data-options="required:true"
					missingMessage="请输入字母!" style="width: 87%;" /></td>
			</tr>
			<tr>
				<th>排序：</th>
				<td ><input name="sort"
				    id = "sort"
					class="easyui-numberspinner" style="width: 155px;" value="100" /></td>
			    <th>状态:</th>
			    <td>
			      <select name="state" id="state">
			        <option value="0">关闭</option>
			        <option value="1">启用</option>
			      </select>
			    </td>
			</tr>
            <tr>
               <th>类型:</th>
               <td>
               <select name="type" id="type">
                 <option value="0">品牌</option>
                 <option value="1">车型</option>
               </select>
               </td>
               <th>缩写图片</th>
               <td><input name="images"
				    id="images"
					value="" class="easyui-validatebox" data-options="required:true"
					missingMessage="请输入图片!" style="width: 87%;" /></td>
              
            </tr>
		</table>
	</form>
</div>
